home *** CD-ROM | disk | FTP | other *** search
/ Software Vault: The Diamond Collection / The Diamond Collection (Software Vault)(Digital Impact).ISO / cdr49 / dispwet1.zip / UPWET.WCC < prev    next >
Text File  |  1995-02-17  |  3KB  |  90 lines

  1. REM WCcode module for moving/unpacking/converting new weather maps.
  2. REM Written by Mark Davis, Crystal Wind Communications, Inc in Jan 1995
  3. REM Released as SHARE-WITH-ME-WARE, if you like it, use it, share
  4. REM something you've done with me. Fido 1:3653/66 BBS 904-564-0101
  5. REM Enjoy...
  6.  
  7. REM this one is not quite finished, as I was going to put a "flag" in
  8. REM to check and see if a user was in the app, so I would not get any
  9. REM share violations overwriting a file someone was trying to download.
  10. REM you may want to finish this...
  11.  
  12. REM Check for new weather files and move to the appropriate dir
  13.  
  14. Dim FlagName as String
  15. FlagName = "D:\WEATHER\MOVING.FLG"
  16. Dim WetDir as String
  17. WetDir = "D:\WEATHER\"
  18. Dim WetSing as String
  19. WetSing = "D:\WEATHER\SINGLES\"
  20. Dim UseFlag as String
  21. UseFlag = "D:\WEATHER\USING.*"
  22. Dim SatDir as String
  23. SatDir = "S:\WETV\"
  24. Dim TBBSdir as String
  25. TBBSdir = "R:\WEATHER\"
  26.  
  27. Dim FlagChk as SearchRec
  28.  
  29. Sub UnzipNew (File2unPAK as String)
  30. REM Unzip newfile to Singles Dir
  31. Dim CommLine as String
  32. CommLine = "Pkunzip -o " + File2unPak + " " + WetSing
  33. Shell CommLine
  34. End Sub
  35.  
  36. Function TestDate (NewFile2Test as String,OldFile2Test as String) as boolean
  37. TestDate = False
  38. Dim D1 as Date
  39. Dim X1 as Time
  40. Dim D2 as Date
  41. Dim X2 as Time
  42. Dim OldFile as String
  43. Dim NewFile as String
  44. Dim Srec1 as SearchRec
  45. OldFile = WetDir + OldFile2Test
  46. Dim Srec2 as SearchRec
  47. NewFile = SatDir + NewFile2Test
  48. If FindFirst(OldFile,0,Srec1) = 0 then
  49.    D1 = Srec1.Date
  50.    X1 = Srec1.Time
  51. End If
  52. If Findfirst(NewFile,0,Srec2) = 0 then
  53.   D2 = Srec2.Date
  54.   X2 = Srec2.Time
  55. End If
  56. If (( D2.Number > D1.Number ) or ( X2.Number > X1.Number )) then
  57.    TestDate = TRUE
  58. End if
  59. End Function
  60.  
  61. REM MAIN PROGRAM
  62.  
  63. RESTART:
  64. If FindFirst(UseFlag,0,FlagChk) = 0 then
  65.     Delay 10
  66.     goto RESTART
  67. End if
  68.  
  69. If (TestDate("RADAR.ARC","RADAR.ZIP")) = TRUE then
  70.    copyfile("S:\WETV\RADAR.ARC","D:\WEATHER\RADAR.ZIP")
  71.    UnZipNew("D:\WEATHER\RADAR.ZIP")
  72.    shell "d:\weather\singles\convrad.bat"
  73. End If
  74.  
  75.  
  76. If (TestDate("SATELITE.ARC","SATELITE.ZIP")) = TRUE then
  77.    copyfile("S:\WETV\SATELITE.ARC","D:\WEATHER\SATELITE.ZIP")
  78.    UnZipNew("D:\WEATHER\SATELITE.ZIP")
  79.    shell "d:\weather\singles\convsat.bat"
  80. End If
  81.  
  82.  
  83. If (TestDate("WEATHMAP.ARC","WEATHMAP.ZIP")) = TRUE then
  84.    copyfile("S:\WETV\WEATHMAP.ARC","D:\WEATHER\WEATHMAP.ZIP")
  85.    UnZipNew("D:\WEATHER\WEATHMAP.ZIP")
  86.    shell "d:\weather\singles\convwet.bat"
  87. End If
  88.  
  89. KILL "D:\WEATHER\MOVING.FLG"
  90.